package com.frank.sboot.blog.service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Service;

import com.frank.sboot.blog.model.Blog;

@Service
public class BlogService {
	public List<Blog> all() {
		List<Blog> result = new ArrayList<Blog>();
		
		Blog blog0 = new Blog();
		blog0.setTitle("Java Helloworld.");
		blog0.setCategory(1);
		blog0.setCreateTime(new Date().toString());
		Blog blog1 = new Blog();
		blog1.setTitle("Java 基本概念");
		blog1.setCategory(1);
		blog1.setCreateTime(new Date().toString());
		Blog blog2 = new Blog();
		blog2.setTitle("js function");
		blog2.setCategory(2);
		blog2.setCreateTime(new Date().toString());
		
		result.add(blog0);
		result.add(blog1);
		result.add(blog2);
		return result;
	}
}
